const db = require("./db.js");

const userSchema = new db.Schema({
    userId:{type:String},
    username:{type:String},
    passwrod:{type:String},
    tel:{type:Number},
    code:{type:String},
    registerTime:{type:Number},
    lastLoginTime:{type:Number},
    email:{type:String},
    nickName:{type:String},
    avatar:{type:String},
    birthday:{type:String},
    sex:{type:Number},
    hobby:{type:Array},
    isLogin:{type:Number}
})

// 根据元对象，创建集合
const user = db.model("user", userSchema);

// 将集合对象暴露出去，准备操作数据
module.exports = user;
